#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

void main ()
{
    
    FILE *fp;
    char ch;
    int i,count,a;
    if((fp=open("/home/besti20155228/20155228代码备份/1011MyOd/hello.c",O_RDONLY,0))==NULL)
    {
        printf("文件打开失败！");
        exit(0);
    }
    count=0;
    while(read(STDIN_FILENO,&ch,1)!=0)
    {
        if(isprint(ch))
        {
            count++;
            write(STDOUT_FILENO,&ch,1);
            printf(" %4x ",ch);
            if(count%8==0)
                printf("\n");
        }

    }
    close(fp);
    printf("\n");
    return 0;
}

